-
Notifications
You must be signed in to change notification settings - Fork 5.4k
feat: Enable automatic updates of preinstalled Snaps #37610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✨ Files requiring CODEOWNER review ✨🫰 @MetaMask/core-platform (2 files, +5 -0)
|
Builds ready [e71e285]
UI Startup Metrics (1228 ± 96 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [be4a143]
UI Startup Metrics (1218 ± 82 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [6db7a96]
UI Startup Metrics (1246 ± 100 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
6db7a96 to
6469b23
Compare
Builds ready [6469b23]
UI Startup Metrics (1216 ± 91 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| "database": "object", | ||
| "lastUpdated": "number", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea why these changed now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The registry was likely not updated in these tests before because the fixture didn't have any third party Snaps. Before this PR we would only update the registry if you had a third party Snap that could have been blocked.
Builds ready [73911c7]
UI Startup Metrics (1110 ± 92 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
cryptodev-2s
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** This PR adds an environment variable for automatically updating preinstalled Snaps and enables it. Following onboarding and as long as the user doesn't opt-out, the Snaps registry will be queried and used to serve updates for preinstalled Snaps. We also keep the existing condition in case the feature flag is turned off in the feature for backwards compatibility with users of third party Snaps. [](https://codespaces.new/MetaMask/metamask-extension/pull/37610?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: Enable automatic updates of preinstalled Snaps <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds an env-flagged auto-update for preinstalled Snaps and refreshes the Snaps registry after onboarding; updates tests and bumps snaps-controllers. > > - **Snaps/Controller**: > - Add `postOnboardingInitialization` logic to call `snapController.updateRegistry()` when `AUTO_UPDATE_PREINSTALLED_SNAPS` is enabled or when any non-preinstalled snap exists; remove redundant background trigger. > - Pass new feature flag `autoUpdatePreinstalledSnaps` to `SnapController` via `SnapControllerInit` (read from `process.env.AUTO_UPDATE_PREINSTALLED_SNAPS`). > - **Config**: > - Define `AUTO_UPDATE_PREINSTALLED_SNAPS: 'true'` in `builds.yml`. > - **Tests**: > - Update `snap-controller-init` test expectations to include `autoUpdatePreinstalledSnaps`. > - Adjust metrics state snapshots to expect populated `SnapsRegistry.database` and `lastUpdated`. > - **Dependencies**: > - Bump `@metamask/snaps-controllers` to `^16.1.1`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 73911c7. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Description
This PR adds an environment variable for automatically updating preinstalled Snaps and enables it. Following onboarding and as long as the user doesn't opt-out, the Snaps registry will be queried and used to serve updates for preinstalled Snaps.
We also keep the existing condition in case the feature flag is turned off in the feature for backwards compatibility with users of third party Snaps.
Changelog
CHANGELOG entry: Enable automatic updates of preinstalled Snaps
Note
Adds an env-flagged auto-update for preinstalled Snaps and refreshes the Snaps registry after onboarding; updates tests and bumps snaps-controllers.
postOnboardingInitializationlogic to callsnapController.updateRegistry()whenAUTO_UPDATE_PREINSTALLED_SNAPSis enabled or when any non-preinstalled snap exists; remove redundant background trigger.autoUpdatePreinstalledSnapstoSnapControllerviaSnapControllerInit(read fromprocess.env.AUTO_UPDATE_PREINSTALLED_SNAPS).AUTO_UPDATE_PREINSTALLED_SNAPS: 'true'inbuilds.yml.snap-controller-inittest expectations to includeautoUpdatePreinstalledSnaps.SnapsRegistry.databaseandlastUpdated.@metamask/snaps-controllersto^16.1.1.Written by Cursor Bugbot for commit 73911c7. This will update automatically on new commits. Configure here.